package com.zrrd.spring_04.controller;

import com.zrrd.spring_04.service.ManagerService;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

//@Component
@Controller
public class ManagerController {
    //@Autowired  //默认按照类型自动装配
    //@Qualifier("managerServiceImpl") //根据名称自动装配。结合@Autowired使用
    //默认是按照名称自动装配，是java提供的javax.annotation.Resource
    @Resource
    private ManagerService managerService;

    public void save() {
        System.out.println("新增管理员Controller层");
        managerService.save();
    }


    public void remove() {
        System.out.println("删除管理员Controller层");
        managerService.remove();
    }


    public void edit() {
        System.out.println("修改管理员Controller层");
        managerService.edit();
    }


    public void query() {
        System.out.println("查询管理员Controller层");
        managerService.query();
    }
}